import request from '@/utils/request'

// 获取用户列表
export const getUserList = (params) => {
  return request({
    url: '/admin/users',
    method: 'get',
    params
  })
}

// 获取用户详情
export const getUserDetail = (userId) => {
  return request({
    url: `/admin/users/${userId}`,
    method: 'get'
  })
}

// 更新用户信息
export const updateUser = (userId, data) => {
  return request({
    url: `/admin/users/${userId}`,
    method: 'put',
    data
  })
}

// 删除用户
export const deleteUser = (userId) => {
  return request({
    url: `/admin/users/${userId}`,
    method: 'delete'
  })
}

// 重置用户密码
export const resetUserPassword = (userId, data) => {
  return request({
    url: `/admin/users/${userId}/reset-password`,
    method: 'put',
    data
  })
}


